﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<CRM.Database.Model.Customers>" %>
<%@ Import Namespace="CRM.AuthorizedActionLink.Extensions" %>
<%@ Import Namespace="CRM.AuthorizedActionLink.Html" %>



<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    <%: Html.DisplayFor(model => model.Name) %>
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

<h2><%: Html.DisplayFor(model => model.Name) %>/<%: Html.DisplayFor(model => model.SequentialNumber) %>/<%: Html.DisplayFor(model => model.ProfineRegionNameLocalized)%>/<%: Html.DisplayFor(model => model.Manager) %></h2>

<p>
    <%: 
    Html.ActionLinkAuthorized(CRM.Resourses.Resourses.Edit, "Edit", "Customers", new { customerId = Model.IdCustomer })%> |
    <%: Html.ActionLink(CRM.Resourses.Resourses.BackToList, "Index") %>
</p>
    
    <% Html.DevExpress().PageControl(settings =>
                                       {
                                           settings.Name = "pcFeatures";
                                           settings.TabPages.Add(CRM.Resourses.Resourses.General).SetContent(() => Html.RenderPartial("General",Model));
                                           //settings.TabPages.Add(CRM.Resourses.Resourses.General).SetContent(() => Html.RenderAction("Gen", "Customers"));
                                           settings.TabPages.Add(CRM.Resourses.Resourses.LegalEntities).SetContent(() => Html.RenderPartial("LegalEntities", Model));
                                           settings.TabPages.Add(CRM.Resourses.Resourses.AgreementElements).SetContent(() => Html.RenderAuthorizedCustomerAction("AgreementElements", "Customers", new { customerId = Model.IdCustomer }));
                                           settings.TabPages.Add(CRM.Resourses.Resourses.Contracts).SetContent(() => Html.RenderAuthorizedCustomerAction("CustomerContractsPartial", "Contracts", new { customerId = Model.IdCustomer }));
                                           settings.TabPages.Add(CRM.Resourses.Resourses.Conditions).SetContent(() => Html.RenderAuthorizedCustomerAction("ConditionsPartial", "Contracts", new { customerId = Model.IdCustomer }));
                                           ////settings.TabPages.Add(CRM.Resourses.Resourses.LegalEntities).SetContent(
                                           ////    () => Html.RenderAuthorizedCustomerAction("CustomerLegalEntities", "Customers", new { customerId = Model.IdCustomer }));
                                           settings.TabPages.Add(CRM.Resourses.Resourses.AddressesAndContacts).SetContent(() => Html.RenderPartial("AddressesAndContacts", Model));
                                           ////settings.TabPages.Add(CRM.Resourses.Resourses.Conditions).SetContent(() => Html.RenderPartial("Conditions", Model));
                                           settings.TabPages.Add(CRM.Resourses.Resourses.Equipment).SetContent(() => Html.RenderPartial("Equipment", Model));
                                           settings.TabPages.Add(CRM.Resourses.Resourses.ProductPortfolio).SetContent(() => Html.RenderPartial("ProductSystems", Model));
                                           ////settings.TabPages.Add(CRM.Resourses.Resourses.Objects).SetContent(() => Html.RenderPartial("Objects", Model));
                                         //  settings.TabPages.Add(CRM.Resourses.Resourses.Turnover).SetContent(() => Html.RenderAuthorizedCustomerAction("Turnovers", "Customers", new { customerId = Model.IdCustomer }));
                                           settings.TabPages.Add(CRM.Resourses.Resourses.Turnover).SetContent(() => Html.RenderPartial("AllTurnovers", Model));
                                           settings.TabPages.Add(CRM.Resourses.Resourses.TC).SetContent(() => Html.RenderAction("CustomerTraining", "TC", Model));
                                           settings.TabPages.Add(CRM.Resourses.Resourses.TechnicService).SetContent(() => Html.RenderAction("TechnicRequestsList", "TD", new { customerItem = Model }));
                                           settings.Width = Unit.Percentage(100);
                                       }).GetHtml(); %>



</asp:Content>
